<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加会员信息</title>

	
 <!-- Bootstrap Core CSS -->
<link href="__PUBLIC__/Theme2/css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<!-- Custom CSS -->
<link href="__PUBLIC__/Theme2/css/style.css" rel='stylesheet' type='text/css' />
<link href="__PUBLIC__/Theme2/css/font-awesome.css" rel="stylesheet"> 
<!-- jQuery -->
<script src="__PUBLIC__/Theme2/js/jquery.min.js"></script>
<link href="__PUBLIC__/Theme2/css/custom.css" rel="stylesheet">
<!-- Metis Menu Plugin JavaScript -->
<script src="__PUBLIC__/Theme2/js/metisMenu.min.js"></script>
<script src="__PUBLIC__/Theme2/js/custom.js"></script>
<!-- Graph JavaScript -->
<script src="__PUBLIC__/Theme2/js/d3.v3.js"></script>
<script src="__PUBLIC__/Theme2/js/rickshaw.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="__PUBLIC__/Theme2/js/bootstrap.min.js"></script>

</head>

<body id="wrapper">
<div id="wrapper">    
		<div class="copyrights"></div>
        
        
        <div class="col-md-12 graphs">
	   <div class="xs">
		<h3 style='text-align:center'>欢迎您通过会员<{$txt_rid}>注册本系统</h3>
	 
  	         <div class="tab-content" style="width:800px;margin:0 auto">
						<div class="tab-pane active" id="horizontal-form">
      <form name="fmOrder"action="__URL__/AddAction" method="post" class="form-horizontal"  onSubmit="return fmCheck();">
								<div class="form-group">
									<label for="focusedinput" class="col-sm-2 control-label">会员编号 </label>
									<div class="col-sm-7">
										<input type="text" class="form-control1" name="txt_loginname1" id="txt_loginname1" onBlur="fmCheckUserName('txt_loginname_msg',this.value,'恭喜,可以使用','对不起,该编号已经使用')" style="width:65%;" value="<{$bianhao}>"  readonly /><input type="button" name="Button2" value="生成编号" id="Button2" onClick="MathRand()" style="margin-left:1%;font-size: 12px;" />
										<input type="hidden" value="<{$bianhao}>" name="txt_loginname" id="txt_loginname"  />
										<span id="txt_loginname_msg"></span>		
									</div>
									<div class="col-sm-3">
										<p class="help-block">* 6-9位数字</p>
									</div>
								</div>
								<div class="form-group">
									<label for="focusedinput" class="col-sm-2 control-label">姓名 </label>
									<div class="col-sm-7">
										<input type="text" class="form-control1" name="txt_bankname"  id="txt_bankname" onBlur="fmname(this.value)" style="width:65%;" />
										<span id="txt_name_msg"></span>		
										
										
									</div>
									<div class="col-sm-3">
										<p class="help-block">*</p>
									</div>
								</div>
								

										
								
								<div class="form-group">
									<label for="focusedinput" class="col-sm-2 control-label">手机号码 </label>
									<div class="col-sm-7">
										<input  name="txt_tel" type="text" class="form-control1" ID="txt_tel" onBlur="shoujihaoma(this.value)" style="width:65%;"/>
										<span id="txt_tel_msg"></span>		
									</div>
									<div class="col-sm-3">
										<p class="help-block">*</p>
									</div>
								</div>
								<div class="form-group">
									<label for="focusedinput" class="col-sm-2 control-label">登陆密码 </label>
									<div class="col-sm-7">
										<input  name="txt_pwd1" type="password" class="form-control1" ID="txt_pwd1"  size="20" maxlength="20" onBlur="checkdenglup(this.value)" style="width:65%;"/>
										<span id="txt_dl_msg"></span>		
										
									</div>
									<div class="col-sm-3">
										<p class="help-block">*(英文字母或数字形式，最多20位)</p>
									</div>
								</div>
								
								<div class="form-group">
									<label for="focusedinput" class="col-sm-2 control-label">二级密码 </label>
									<div class="col-sm-7">
										<input  name="txt_pwd2" type="password" class="form-control1" ID="txt_pwd2"  size="20" maxlength="20" onBlur="checkerp(this.value)" style="width:65%;"/>
										<span id="txt_er_msg"></span>		
									</div>
									<div class="col-sm-3">
										<p class="help-block">*(英文字母或数字形式，最多20位)</p>
									</div>
								</div>
								<div >
									<div class="row">
										<div class="col-sm-8 col-sm-offset-2">
											<input type="hidden"  name="txt_rid"    value="<{$txt_rid}>"/>
											<input name="Submit2" type="submit" class="btn-success btn"  style="    width: 50%;font-size: 18px;" value="提  交">
											
										</div>
										
									</div>
  <div class="money_ma"></div>
								 </div>
								<div style="display:none;">
								会员正在注册中，请稍等
								</div>
							</form>
						</div>
					</div>
	
	
  </div>
  
   </div>
       
   </div>


<div id="top_banner" class="layout"></div>
<div id="content" class="layout">


<script language="javascript">

    function MathRand()
    {
       var Num="";
       for(var i=0;i<8;i++)
       {
          Num+=Math.floor(Math.random()*10);
       }	   
       document.getElementById("txt_loginname1").value=Num;
       document.getElementById("txt_loginname").value=Num;
    }
function f(n){return document.getElementById(n);}
     function fmCheckUserName(str,thisvalue,txt1,txt2)
    {
		
		//if (thisvalue==""||thisvalue.length!=8) {alert("会员编号输入错误1！");return false;}
        htmlobj=$.ajax({url:"ajax.php?do=CheckUserName&username=" + escape(thisvalue),async:false});
		if (escape(htmlobj.responseText)=="0"){f(str).innerHTML=txt1;return false;}
		if (escape(htmlobj.responseText)=="1"){f(str).innerHTML=txt2;return false;}
    }
    function shoujihaoma(thisvalue){
		
			var reg = /^\d{9,}$/;

     if(!reg.test(thisvalue)){
		document.getElementById("txt_tel_msg").innerHTML = "<font color='red'>手机号码不正确</font>";
		txt_tel.focus();
		return false;
     }
	 else{
		document.getElementById("txt_tel_msg").innerHTML = "";
	 }
	 
	 
	}
	function checkdenglup(thisvalue){
		if(thisvalue.length<6)
		{
			document.getElementById("txt_dl_msg").innerHTML = "<font color='red'>请输入6位以上的登录密码</font>";
		}
		else{
			document.getElementById("txt_dl_msg").innerHTML = "";
		}
	}
	function checkerp(thisvalue){
		if(thisvalue.length<6)
		{
			document.getElementById("txt_er_msg").innerHTML = "<font color='red'>请输入6位以上的二级密码</font>";
		}
		else{
			document.getElementById("txt_er_msg").innerHTML = "";
		}
	}
	function fmname(thisvalue){
		if(thisvalue.length==0)
		{
			document.getElementById("txt_name_msg").innerHTML = "<font color='red'>姓名不能为空</font>";
		}
		else{
			document.getElementById("txt_name_msg").innerHTML = "";
		}
	}
    function fmCheck()
    {
        with(document.fmOrder)
        {
		    if (txt_loginname.value==""||txt_loginname.value.length<6) {alert("会员编号输入错误！");txt_loginname.focus();txt_loginname.style.border="1px solid #888888";return false;}
			
			if (txt_bankname.value=="") {alert("请输入姓名！");txt_bankname.focus();txt_bankname.style.border="1px solid #888888";return false;}
			
            if (txt_rid.value=="") {alert("推荐人不能为空！");txt_rid.focus();txt_rid.style.border="1px solid #888888";return false;}
			if (txt_tel.value=="") {alert("请输入手机号码！");txt_tel.focus();txt_tel.style.border="1px solid #888888";return false;}

			var reg = /^\d{9,}$/;

				 if(!reg.test(txt_tel.value)){
					alert("手机号码不正确！");txt_tel.focus();txt_tel.style.border="1px solid #888888";return false;
				

				 }
			

			if (txt_pwd1.value=="") {alert("请输入登录密码！");txt_pwd1.focus();txt_pwd1.style.border="1px solid #888888";return false;}

			if (txt_pwd2.value=="") {alert("请输入二级密码！");txt_pwd2.focus();txt_pwd2.style.border="1px solid #888888";return false;}

			

        }
    }


</script>


		  
		  
		  
</div>
  </div>
  <div class="clear"></div>
</div>


</body>

</html>
